import React, { Suspense } from 'react';
import { useRoutes, Link } from 'react-router-dom';
import routes from "./router/routes"
//引入自己定义的守卫hook
import useRouteWithGuard from "./hooks/useRouteWithGuard"
import './App.css';
import { Layout } from 'antd';
import LayoutBase from './layOut';

function App() {
  let element = useRouteWithGuard({ routes, tokenKey: "qf-token" })
  return (

    // <div className={[appStyle.App,appStyle.bj].join(" ")}>
    <div className="app">
      {/* <Link to="/login">登入</Link>
      <br/>
      <Link to="/home">首页</Link> */}
      <LayoutBase>
        <Suspense fallback={<h1>正在加载</h1>}>
          {element}
        </Suspense>
      </LayoutBase>
    </div>
  );
}

export default App;
